package com.css.zfzx.sjcj.modules.hddcFaultSvyPoint.repository;

import com.css.zfzx.sjcj.modules.hddcFaultSvyPoint.repository.entity.HddcFaultsvypointEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author lihelei
 * @date 2020-11-26
 */
public interface HddcFaultsvypointRepository extends JpaRepository<HddcFaultsvypointEntity, String> {
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_faultsvypoint set qualityinspection_status=:s ,extends1=:str where uuid=:id")
    void updateStatus(String s, String str, String id);
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_faultsvypoint set qualityinspection_status=:s ,extends2=:str where uuid=:id")
    void updateStatus2(String s, String str, String id);

    @Query(nativeQuery = true,value = "select * from hddc_faultsvypoint where is_valid=1 and (qualityinspection_status!=3 or qualityinspection_status is null) ")
    List<HddcFaultsvypointEntity> findByAll();

    HddcFaultsvypointEntity findByUuidAndIsValid(String id, String isValid);
}
